home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000114-20000217 / 000141_news@columbia.edu _Tue Jan 25 15:27:48 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id PAA07930
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Tue, 25 Jan 2000 15:27:47 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id PAA22711
  7.     for kermit.misc@watsun.cc.columbia.edu; Tue, 25 Jan 2000 15:15:13 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: Peter Burkholder <pburkholder@seanet.com>
  10. Subject: Re: Changing Unix C-kermit> prompt
  11. Date: Tue, 25 Jan 2000 12:06:54 -0800
  12. Organization: University of Washington
  13. Message-ID: <388E025E.60D8E098@seanet.com>
  14. To: kermit.misc@columbia.edu
  15.  
  16. Thanks Frank,
  17.  
  18. Now I see where "set prompt" is in the index.  I'm still
  19. finding my way around this program, but liking it better
  20. all the time.  Thanks for the tip.
  21.  
  22. Cheers,
  23.  
  24. Peter
  25.  
  26.  
  27. CheersFrank da Cruz wrote:
  28. > In article <388DD7E6.ED7EA6A6@seanet.com>,
  29. > Peter Burkholder  <peter@geophys.washington.edu> wrote:
  30. > : I'm doing some script writing rather deep in my directory
  31. > : tree, so I'm always looking at a prompt like:
  32. > :
  33. > :   (/export/home/badger/spyder/kermit/ck7/) C-Kermit>
  34. > :
  35. > : which hardly leaves space for my commands w/o wrapping.  I don't
  36. > : see in the book or documentation how I truncate the current
  37. > : directory listing, but I hope there is.  I'd be happy with;
  38. > :   (ck7) C-Kermit>
  39. > :
  40. > The prompt definition can contain macros, variables, function calls,
  41. > or anything else.  The definition is re-evaluated each time the prompt
  42. > changes.  The default definition is:
  43. >   (\v(directory)) C-Kermit>
  44. > which shows the current directory in parentheses; if you give a CD
  45. > command, the prompt changes.
  46. > C-Kermit 7.0 includes a lot of new string functions.  Unfortunately, none
  47. > of them does exactly what you need (one of them, \fstripx(), does exactly
  48. > the opposite: removes the rightmost segment from the string).
  49. > But where there's a will, there's a way:
  50. >  set prompt (\freplace(\fsubstr(\v(dir),\frindex(/,\v(dir),2)),/,)) C-Kermit>
  51. > In which:
  52. > \frindex(/,\v(dir),2)
  53. >   Gives the position of the rightmost slash not counting the trailing one.
  54. > \fsubstr(\v(dir),\frindex(/,\v(dir),2))
  55. >   Gives the rightmost directory segment, with slashes
  56. > \freplace(\fsubstr(\v(dir),\frindex(/,\v(dir),2)),/,)
  57. >   Removes the the slashes.
  58. > The result, in your case, should be:
  59. >   (ck7) C-Kermit>
  60. > You can achieve any other desired effect with C-Kermit's string functions.
  61. > Most of them are documented in "Using C-Kermit".  New ones are documented
  62. > in the ckermit2.txt file.  The SHOW FUNCTIONS command lists the functions
  63. > that are available.  In C-Kermit 7.0, you can get help on a particular
  64. > function with:
  65. >   help function xxx
  66. > where xxx is the function name.  This tells you the calling sequence,
  67. > action, and return value.
  68. > - Frank
  69.  
  70.     (*)/ (*)